package application.common.render;

import application.common.model.Cabinet;
import javafx.beans.property.SimpleStringProperty;

public final class CabinetProperty {

	private final SimpleStringProperty id = new SimpleStringProperty();
	private final SimpleStringProperty name = new SimpleStringProperty();
	private final SimpleStringProperty code = new SimpleStringProperty();
	private final SimpleStringProperty type = new SimpleStringProperty();
	private final SimpleStringProperty total = new SimpleStringProperty();
	private final SimpleStringProperty usedNum = new SimpleStringProperty();
	private final SimpleStringProperty freeNum = new SimpleStringProperty();
	private final SimpleStringProperty errorNum = new SimpleStringProperty();
	private final SimpleStringProperty comPort = new SimpleStringProperty();
	private final SimpleStringProperty baudRate = new SimpleStringProperty();
	private final SimpleStringProperty sort = new SimpleStringProperty();

	public CabinetProperty(Cabinet cabinet) {
		id.set(cabinet.getId());
		name.set(cabinet.getName());
		code.set(cabinet.getCode());
		type.set(cabinet.getType());
		total.set(cabinet.getTotal() + "");
		usedNum.set("0");
		freeNum.set("0");
		errorNum.set("0");
		comPort.set(cabinet.getComPort() + "");
		baudRate.set(cabinet.getBaudRate() + "");
		sort.set(cabinet.getSort() + "");
	}

	public String getId() {
		return id.get();
	}

	public String getName() {
		return name.get();
	}
	
	public void setName(String value) {
		name.set(value);
	}

	public String getCode() {
		return code.get();
	}
	
	public void setCode(String value) {
		code.set(value);
	}

	public String getType() {
		return type.get();
	}

	public void setType(String value) {
		type.set(value);
	}

	public String getTotal() {
		return total.get();
	}

	public String getUsedNum() {
		return usedNum.get();
	}

	public String getFreeNum() {
		return freeNum.get();
	}

	public String getErrorNum() {
		return errorNum.get();
	}

	public String getComPort() {
		return comPort.get();
	}
	
	public void setComPort(String value) {
		comPort.set(value);
	}
	

	public String getBaudRate() {
		return baudRate.get();
	}
	

	public void setBaudRate(String value) {
		baudRate.set(value);
	}
	

	public String getSort() {
		return sort.get();
	}

	public void setSort(String value) {
		sort.set(value);
	}

}
